# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: rubicon <rubicon@mailo.com>
pkgname=fnc
pkgver=0.12
pkgrel=0
pkgdesc="interactive ncurses browser for Fossil repositories"
url="https://fnc.bsdbox.org/"
arch="all"
license="ISC"
makedepends="zlib-dev bsd-compat-headers ncurses-dev"
options="!check"
subpackages="$pkgname-doc"
source="https://fnc.bsdbox.org/uv/dl/$pkgname-$pkgver.tar.gz
	maybe-uninit.patch
	"

build() {
	# todo: actually fix the uninit
	export CFLAGS="${CFLAGS/-Os/-O2}"
	make
}

check() {
	./src/fnc -v
}

package() {
	# workaround for Makefile not calling
	# install with option to create dirs
	mkdir -vp "$pkgdir"/usr/bin
	make PREFIX="$pkgdir"/usr install
	install -vDm644 README.md CHANGES.md LICENSE \
		-t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="
6831a4cc03d87b29ad5fef3f74c5afdb42c0ce6c36ee058e63749dbe4889fe23b6ff3c4ab5fd91d61455772491b8129b34b8fdd511206f599ee90b281717d24d  fnc-0.12.tar.gz
05ad06516858b91aa545fd589fb48a5d621b85c11d70e8bd521e4f429b632c9396d04367904155a865561721d918c0bec3f5b439b97584f6986a1c398c7e0476  maybe-uninit.patch
"
